#!/bin/bash
path1=`pwd`
npmpath=/usr/local/node/bin
gzname=`ls |grep "tar.gz"`
string1=`pwd |awk -F'/' '{print $NF}'`
npmpid=`ps aux |grep ${string}|grep node|awk -F' ' '{print $2}'`
datetime=`date +%Y%m%d`
allfile=`ls |grep -v "tar.gz"`
tar zxvf ${gzname}
touch ${path1}/log.${datetime}
${npmpath}/cnpm install > /dev/null 2>&1
kill -9 ${npmpid}
${npmpath}/node $path1/bin/www >> ${path1}/log.${datetime} 2>&1 &
